package com.guc.gutils;

import java.io.File;

/**
 * Hello world!
 */
public class App {
    public static void main(String[] args) {
//        long time = System.currentTimeMillis();
//        System.out.println("当前时间：" + time);
//        System.out.println(DateTimeUtil.format(time));
//        System.out.println(DateTimeUtil.string2Date("20210819000000", null));
//        String ts = "20210819000000";
//        System.out.println("原时间格式：" + ts);
//        System.out.println(DateTimeUtil.transform(ts, DateTimeUtil.PATTERN_YMDHMS, DateTimeUtil.PATTERN_Y_M_D_H_M_S));
//        System.out.println(new Gson().toJson(new HashMap() {{
//            put("name", "你好");
//            put("sex", "男");
//        }}));

        System.out.println("IP:" + NetUtil.getNetIp());
        String pic = Base64Util.getBase64ByUrl("https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg.jj20.com%2Fup%2Fallimg%2Ftp05%2F19100120461512E-0-lp.jpg&refer=http%3A%2F%2Fimg.jj20.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1640486492&t=d915db687038f5cef541a31b66dc934e");
        File file = Base64Util.base642Picture(pic, "E:/pic/GD" + System.currentTimeMillis() + ".jpg");
        if (file != null) {
            System.out.println("图片已保存至：" + file.getAbsolutePath());
        }

    }
}
